package com.zhiyou100.entity;

import java.io.Serializable;

//为ajax响应创建的类
public class ResponseEntity<T>   implements Serializable{
      private Integer status;/*响应状态码*/
      private String message;/*状态描述信息*/
      private  T    obj;/*响应的j对象  需要转换为json串*/

    @Override
    public String toString() {
        return "ResponseEntity{" +
                "status=" + status +
                ", message='" + message + '\'' +
                ", obj=" + obj +
                '}';
    }

    public ResponseEntity() {
    }

    public ResponseEntity(Integer status, String message, T obj) {
        this.status = status;
        this.message = message;
        this.obj = obj;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public T getObj() {
        return obj;
    }

    public void setObj(T obj) {
        this.obj = obj;
    }
}
//获取一个：getOne::1
//1  不存在：响应  ResponseEntity<Exam>：status=401  message="id不存在"   obj=null
//2  存在：响应  ResponseEntity<Exam>：status=200      obj=Exam
